import request from "@/utils/request";
import config from "@/config";
// 小程序获取当前用户的会话列表
export function getCurrentConversationList(params) {
	return request({
		url: `/pw/conversation/getCurrentConversationList`,
		headers: {
			isToken: false,
		},
		method: "get",
		params
	});
}
// 聊天记录
export function history(params) {
	return request({
		url: `/pw/messages/history/current`,
		headers: {
			isToken: true,
		},
		method: "get",
		params
	});
}
// 发送消息
export function sends(data) {
	return request({
		url: `/pw/messages/send`,
		headers: {
			isToken: true,
		},
		method: "post",
		data
	});
}
// 删除会话
export function deleteConversation(params) {
	return request({
		url: `/pw/conversation/deleteConversation`,
		headers: {
			isToken: true,
		},
		method: "get",
		params
	});
}
// 小程序查询当前用户所有会话未读数的总和
export function getCurrentUserUnreadCount(params) {
	return request({
		url: `/pw/conversation/getCurrentUserUnreadCount`,
		headers: {
			isToken: true,
		},
		method: "get",
		params
	});
}